<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://jmix.io/schema/ui/window"
        caption="msg://UserBrowse.caption"
        focusComponent="usersTable">
    <data readOnly="true">
        <collection id="usersDc"
                    class="su.myjmixprojects.lordsandplanetsjmix.entity.User">
            <fetchPlan extends="_base"/>
            <loader id="usersDl">
                <query>
                    <![CDATA[select e from User e order by e.username]]>
                </query>
            </loader>
        </collection>
    </data>
    <actions>
        <action id="lookupSelectAction"
                caption="msg:///actions.Select"
                icon="LOOKUP_OK"
                primary="true"
                shortcut="${COMMIT_SHORTCUT}"/>
        <action id="lookupCancelAction"
                caption="msg:///actions.Cancel"
                icon="LOOKUP_CANCEL"/>
    </actions>
    <facets>
        <dataLoadCoordinator auto="true"/>
        <screenSettings auto="true"/>
        <presentations auto="true"/>
    </facets>
    <dialogMode height="600"
                width="800"/>
    <layout spacing="true" expand="usersTable">
        <filter id="filter" dataLoader="usersDl">
            <properties include=".*"/>
        </filter>
        <groupTable id="usersTable"
                    width="100%"
                    dataContainer="usersDc"
                    multiselect="true">
            <actions>
                <action id="create" type="create"/>
                <action id="edit" type="edit"/>
                <action id="remove" type="remove"/>
                <action id="showRoleAssignments" type="showRoleAssignments"/>
                <action id="showUserSubstitutions" type="showUserSubstitutions"/>
                <action id="changePassword" type="changePassword"/>
                <action id="resetPassword" type="resetPassword"/>
                <action id="resetRememberMeToken" type="resetRememberMeToken"/>
            </actions>
            <columns>
                <column id="username"/>
                <column id="firstName"/>
                <column id="lastName"/>
                <column id="email"/>
                <column id="timeZoneId"/>
                <column id="active"/>
            </columns>
            <simplePagination/>
            <buttonsPanel id="buttonsPanel"
                          alwaysVisible="true">
                <button id="createBtn" action="usersTable.create"/>
                <button id="editBtn" action="usersTable.edit"/>
                <button id="removeBtn" action="usersTable.remove"/>
                <button id="showRoleAssignmentsBtn" action="usersTable.showRoleAssignments"/>
                <popupButton id="additionalActionsBtn" caption="msg://additional" icon="GEARS">
                    <actions>
                        <action id="usersTable.changePassword"/>
                        <action id="usersTable.resetPassword"/>
                        <action id="usersTable.resetRememberMeToken"/>
                        <action id="usersTable.showUserSubstitutions"/>
                    </actions>
                </popupButton>
            </buttonsPanel>
        </groupTable>
        <hbox id="lookupActions" spacing="true" visible="false">
            <button action="lookupSelectAction"/>
            <button action="lookupCancelAction"/>
        </hbox>
    </layout>
</window>
